package com.bbg.amyam.domain.model;

import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaActiveRecord(finders = { "findProgramsByProgramCategory", "findProgramsBySchool" })
public class Program {

    @NotNull
    @Column(unique = true)
    @Size(max = 30)
    private String name;

    @NotNull
    private String description;

    @NotNull
    @ManyToOne
    private ProgramCategory programCategory;

    @NotNull
    private Boolean activeStatus;

    @NotNull
    @ManyToOne(fetch = FetchType.LAZY)
    private School school;
}
